package com.dragon.app.ykd.service;

import java.util.List;
import java.util.Map;

import com.dragon.app.commons.dto.JiaYinJinKApplyLoanDTO;
import com.dragon.app.commons.dto.ProductApplyDTO;
import com.dragon.app.ykd.dto.AcLoanApplyNode;
import com.dragon.app.ykd.dto.LoanExtensionRecoreds;
import com.dragon.app.ykd.dto.SaveLinkmansDTO;
import com.dragon.app.ykd.dto.UserDataDTO;
import com.dragon.loan.entity.AcApplyEnvironmentInfo;
import com.fintech.common.vo.FintechResult;
import com.fintech.user.entity.User;
import com.marvels.loanapply.dto.MclaLoanApplyLinkmanDTO;

public interface ClientAppService {
	
	/**
	 * 获取第三方查询数据LOANID
	 * 
	 * @param loanId
	 * @return
	 */
	FintechResult getThirdLoanId(String loanId);
	
	
	/**
	 * 验证是否有正在进件的工单
	 * 
	 * @param shortUrl
	 * @param response
	 * @return
	 */
	public FintechResult loanVerify(String accessToken, String idFintechUmUser);
	
	
	/**
	 * 客户app第一次进件 立即申请
	 * 
	 * @param shortUrl
	 * @param response
	 * @return
	 */
	public FintechResult applyLoan(ProductApplyDTO productApplyDTO,AcApplyEnvironmentInfo acApplyEnvironmentinfo, String accessToken,
			String idFintechUmUser);
	
	
	/**
	 * 复贷申请
	 * 
	 * @param productApplyDTO
	 * @param acApplyEnvironmentinfo
	 * @param accessToken
	 * @param idFintechUmUser
	 * @return
	 */
	public FintechResult applyReLoan(ProductApplyDTO productApplyDTO, AcApplyEnvironmentInfo acApplyEnvironmentinfo,
			String accessToken, String idFintechUmUser);
	
	/**
	 * 复贷申请
	 * 
	 * @param productApplyDTO
	 * @param acApplyEnvironmentinfo
	 * @param accessToken
	 * @param idFintechUmUser
	 * @return
	 */
	public FintechResult applyV2ReLoan(ProductApplyDTO productApplyDTO, AcApplyEnvironmentInfo acApplyEnvironmentinfo,
			String accessToken, String idFintechUmUser);
	
	/**
	 * 保存紧急联系人
	 * @param loanApplyLinkmanList
	 * @param userId
	 * @return
	 */
	public FintechResult saveRelation(List<MclaLoanApplyLinkmanDTO> loanApplyLinkmanList, Integer userId);
	
	
	/**
	 * 保存用户对应的联系人信息
	 * 
	 * @param acLinkmanMobiles
	 * @param accessToken
	 * @param idFintechUmUser
	 * @return
	 */
	public FintechResult saveLinkmans(List<SaveLinkmansDTO> acLinkmanMobiles,Integer userId);

	/**
	 * @Description 保存用户工作/居住/联系人 
	 * @param acLinkmanMobiles
	 * @param userId
	 * @return
	 */
	public FintechResult saveContactInfo(UserDataDTO userData,Integer userId);
	
	/**
	 * 获取当前未结清单的节点信息
	 * 
	 * @param userId
	 * 
	 * @return
	 */
	public FintechResult queryLastApplyNode(int userId);
	
	/**
	 * 获取用户所有申请信息
	 * 
	 * @param userId
	 * 
	 * @return
	 */
	public FintechResult queryAllApplyeList(int userId,String loanStatus);
	
	/**
	 * 添加节点流程信息
	 * 
	 * @param acLoanApplyNode
	 *            {loanId--贷款编号, nodeCode--节点编码（1.通讯录已授权 2.运营商已认证 3.支付宝已认证 4.审核中
	 *            5.审核通过 6.审核拒绝 7.确认借款）}
	 * @return
	 */
	public FintechResult addLoanApplyNode(AcLoanApplyNode acLoanApplyNode);
	
	/**
	 * 添加通讯录认证成功节点流程信息（通讯录数据都获取成功后再调用）
	 * 
	 * @param loanId--贷款编号
	 * @return
	 */
	public FintechResult addLinkManAuthNode(String loanId);
	
	public FintechResult addLinkManAuthNodeV2(String loanId, String accessToken, String idFintechUmUser);
	
	/**
	 * 魔蝎TASKID回调
	 * 
	 * @param map
	 *            {taskId--魔蝎任务ID,loanId--贷款编号,mobile--手机号码,type--魔蝎类型（1.运营商
	 *            2.公积金 3.支付宝）}
	 * @return
	 */
	public FintechResult callBackMxTask(Map<String, String> map);
	
	/**
	 * 触发审核
	 * 
	 * @param loanId
	 * @return
	 */
	public FintechResult doApprove(String loanId);
	
	/**
	 * 确认贷款详情信息
	 * 
	 * @param loanId
	 *            {loanId--贷款编号}
	 * @return
	 */
	public FintechResult queryLoanApplyInfo(String loanId);
	
	/**
	 * 确认贷款数据是否完整（绑卡、签合同）
	 * 
	 * @param loanId
	 *            {loanId--贷款编号}
	 * @return
	 */
	public FintechResult confirmLoanDataFull(String loanId);
	
	/**
	 * 展示合同信息
	 * 
	 * @param loanId
	 * @return
	 */
	public FintechResult showContract(String loanId);
	
	/**
	 * 查询当前线上产品
	 * 
	 * @return
	 */
	public FintechResult queryProductType();
	
	/**
	 * 确认展期信息
	 * 
	 * @param loanExtensionRecoreds
	 * @return
	 */
	public FintechResult confirmLoanExtension(LoanExtensionRecoreds loanExtensionRecoreds);
	
	/**
	 * 通过loanId查询展期信息
	 * 
	 * @param loanId
	 * @return
	 */
	public FintechResult queryLoanExtensionByLoanId(String loanId);
	
	
	/**
	 * 确认贷款申请
	 * 
	 * @param loanId
	 *            {loanId--贷款编号}
	 * @return
	 */
	public FintechResult confirmLoanApply(String loanId,User user);
	
	public FintechResult contractContent(String loanId);
	
	/**
	 * jiaYinJinK 放款信息保存
	 * @param jiaYinJinKApplyLoanDTO
	 * @return
	 */
	public FintechResult jiaYinJinKApplyLoan(JiaYinJinKApplyLoanDTO jiaYinJinKApplyLoanDTO);
}
